import { defineStore } from "pinia";
import {ref} from "vue"

export const useLayouterStore = defineStore(
  "layouter",
  () => {
	const screenHeight = ref('')
	const screenWidth = ref('')
	uni.getSystemInfo({
			success: (res) => {
				console.log(res);
				let height = res.screenHeight-res.safeAreaInsets.bottom
				let width = res.screenWidth
				screenHeight.value = (height / (width/750  )) 
				screenWidth.value = (width / (width/750  )) 
				console.log(screenHeight.value)
				console.log(screenWidth.value);
				console.log(height)
				console.log(width);
			}
		})
	
    return { screenHeight,screenWidth };
  },
  {
    unistorage: true, // 开启后对 state 的数据读写都将持久化
  },
);